<!DOCTYPE html>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<body>
<script>
'use strict';

const kElementNameDOMInvalidHTMLParserValid = 1968;
const kElementNameDOMValidHTMLParserInvalid = 1969;

test(() => {
  assert_false(internals.isUseCounted(document, kElementNameDOMInvalidHTMLParserValid),
               'element name: DOM invalid, HTML valid');
  assert_false(internals.isUseCounted(document, kElementNameDOMValidHTMLParserInvalid),
               'element name: DOM valid, HTML invalid');
  assert_throws_dom('InvalidCharacterError', () => document.createElement('foo"'));
  assert_true(internals.isUseCounted(document, kElementNameDOMInvalidHTMLParserValid),
               'element name: DOM invalid, HTML valid');
  assert_false(internals.isUseCounted(document, kElementNameDOMValidHTMLParserInvalid),
               'element name: DOM valid, HTML invalid');

  document.createElement(':foo');
  assert_true(internals.isUseCounted(document, kElementNameDOMValidHTMLParserInvalid),
              'element name: DOM valid, HTML invalid');
}, 'name validity failures tickle use counters');
</script>
</html>
